#include<iostream>
using namespace std;
int main()
{
	int a=1189;
	int b=841;
	char x; 
	int y=0;
	cin>>x>>y;
	while(y--)
	{
		a/=2;
		swap(a,b);
	}
	cout<<a<<endl;
	cout<<b<<endl;
	return 0;	
}
